package com.slkj.shilixiaoyuanapp.util;

import android.os.Build;
import android.support.annotation.RequiresApi;

import java.util.List;
import java.util.Objects;
import java.util.StringJoiner;

/**
 * Created  on 2018-08-02
 *
 * @author 唐开阔
 * @describe
 */
public class StringUtils {
    public static String listToString(List<String> stringList){
        if(stringList==null) {
            return null;
        }
        StringBuilder result = new StringBuilder();
        boolean flag=false;
        for(String string : stringList) {
            if(flag) {
                result.append(",");
            }else{
                flag=true;
            }
            result.append(getString(string));
        }
        return "[" + result.toString() + "]";
    }

    private static String getString(String string) {
        return "\"" + string + "\"";
    }
}
